<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <!-- css -->

    <link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.15/css/jquery.dataTables.css">
    <!-- jQuery -->
    <script type="text/javascript" charset="utf8" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>

    <!-- DataTables -->
    <!--<script type="text/javascript" charset="utf8" src="http://cdn.datatables.net/1.10.15/js/jquery.dataTables.js"></script>-->
    <script type="text/javascript" src="/js/jquery.dataTables.js"></script>
</head>
<body>
<input type="search" placeholder="终止时间" class="timeEnd"  style="float: right">
<input type="search" placeholder="起始时间" class="timeStart"  style="float: right">

<input type="search" placeholder="最小金额" class="moneyMin" style="float: right">
<input type="search" placeholder="最大金额" class="moneyMax" style="float: right">
<button type="button" style="float: right" id="query">查询</button>
<table id="table_id_example">

</table>

</body>
<script type="text/javascript">

    var table=null;

    $(document).ready( function () {

     table= $('#table_id_example').DataTable( {
            "ajax":
                {
                    "url": "/order/queryData",
                    "type": "POST",
                    // "data": function ( data ) {
                    //     var timeStart=$('.timeStart').val();
                    //     var timeEnd=$('.timeEnd').val();
                    //     data.timeStart=timeStart;
                    //     data.timeEnd=timeEnd;
                    // }
                },
            "sPaginationType" : "full_numbers",
            "iDisplayLength": 20,
            "aLengthMenu" : [20, 40, 60],
            "paging":true,
            "searching":false,
            "serverSide": true,
            "bLengthChange": false,
            "language": {
                "sProcessing": "处理中...",
                "sLengthMenu": "显示 _MENU_ 项结果",
                "sZeroRecords": "没有匹配结果",
                "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
                "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
                "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
                "sSearch": "搜索:",
                "sEmptyTable": "表中数据为空",
                "sLoadingRecords": "载入中...",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上页",
                    "sNext": "下页",
                    "sLast": "末页"
                }
            },
            "aoColumns": [
                { "mData": "createdTime","title":"昵称"},
                { "mData": "id","title":"电话"}
            ],
        });


    });

    $('#query').click(function (){
        console.log('123');
        table.ajax.url( '/order/queryData' ).load();
    })

</script>
</html>
